package handlers;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.handlers.HandlerUtil;

public class SayHelloHandler extends AbstractHandler {

	@Override
	public Object execute(ExecutionEvent event) throws ExecutionException {
		IStructuredSelection structSel = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
		for (Object selOb : structSel.toList()) {
			if (selOb instanceof String)
				System.out.println(selOb.toString()+"says hello");
		}
		return null; 
	}

}
